<?php

namespace app\common\model;

use think\Db;
use think\Model;


class TutorSaleItem extends Model
{

    

    

    // 表名
    protected $name = 'tutor_sale_item';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];
	
	
	/**
	 * 添加销售记录
	 * @param $teamId
	 * @param $userId
	 * @param $orderId
	 * @param $number
	 * @return int|string
	 */
	public static function addRow($teamId, $userId, $orderId, $number) {
		return Db::name('tutorSaleItem')
			->insert([
				'team_id' => $teamId,
				'user_id' => $userId,
				'order_id' => $orderId,
				'number' => $number,
				'create_time' => time()
			]);
	}






}
